JAMS Developer Guide
GetValueOrDefault<T>(String,T) Method


MVPSI.JAMS Namespace > PropertyValueCollection Class > GetValueOrDefault Method : GetValueOrDefault<T>(String,T) Method
The name of the property
The value to return if the property name is not found
Gets the value of a property if that property is defined. If it is not defined, returns the specified default value.
Syntax
'Declaration
 
Public Overloads Function GetValueOrDefault(Of T)( _
   ByVal propertyName As System.String, _
   ByVal defaultValue As T _
) As T
'Usage
 
Dim instance As PropertyValueCollection
Dim propertyName As System.String
Dim defaultValue As T
Dim value As T
 
value = instance.GetValueOrDefault(Of T)(propertyName, defaultValue)
public T GetValueOrDefault<T>( 
   System.string propertyName,
   T defaultValue
)

Parameters

propertyName
The name of the property
defaultValue
The value to return if the property name is not found

Type Parameters

T
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

PropertyValueCollection Class
PropertyValueCollection Members
Overload List